<template>
  <a-spin :spinning="spinning != 0">
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="pagination"
        @change="handleTableChange"
      >
        <template slot="serialNum" slot-scope="text,record,index">
          {{(pagination.current-1) * pagination.pageSize + parseInt(index) + 1}}
        </template>
      </a-table>
    </div>
  </a-spin>
</template>

<script>

  import { ViewMixin } from '@/mixins/ViewMixin'
  import YchConstant from "@/api/YchConstant";

  export default {
    name: 'BpmVariable',
    mixins: [ViewMixin],
    props: {
      processInstanceId: {
        type: String,
        default: null
      }
    },
    data () {
      return {
        url: {
          list: YchConstant.PREFIX_BPM + '/bpm-back/processInstanceRest/getVariableListByPage/v1'
        },
        queryParam: {
          processInstanceId: this.processInstanceId
        },//查询参数
        columns: [{
          title:this.$t('m.common.label.number'),
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          scopedSlots: { customRender: 'serialNum' },
        }, {
          title: this.$t('m.bpm.entity.varName'),
          dataIndex: 'name',
          align: 'center',
          width: 180
        }, {
          title: this.$t('m.bpm.entity.varValue'),
          dataIndex: 'value',
          align: 'center',
          width: 180
        }, {
          title: this.$t('m.bpm.entity.varType'),
          dataIndex: 'type',
          width: 80,
          align: 'center'
        }, {
          title: this.$t('m.bpm.entity.varCreateTime'),
          dataIndex: 'createTime',
          width: 80,
          align: 'center'
        }],
      }
    },
    methods: {}
  }
</script>
